Hider control

(c) 1998 Vitas Ramanchauskas
email: vitas@soft4you.com
WEB: http://soft4you.com

Hider control helps you make your application completely invisible. It disappears even from system task list (i.e. it is not listed even in the Ctrl-Alt-Del list).

Also Hider control provides easy way to launch your application automatically at Windows startup.

Hider is very simple control. It has just two properties (both available at runtime only). Hider is invisible at runtime.

Visual Basic sample program is included.

Unregistered version plays sound each time the application goes to invisible state.

Programming FAQ:

Q: How do I hide my application ?

A: Hider control does not hide your application's window, it just removes it from task list. Use hide method of your form object to make it invisible (or ShowWindow(SW_HIDE) in Visual C++).

Q: I want to make my application initially invisible...

A: No problem if you use Visual Basic. Just set form's property called 'visible' to False. If you use Visual C++ & MFC then:

1. If your application is SDI or MDI then remove in <yourApplicationClass>::InitInstance calls to ShowWindow/UpdateWindow

2. If your application is dialog-based then you have to override DoModal virtual function because original implementation does not allow make your dialog invisible. Click here for more details.

Q: How much memory Hider control takes ?

A: Hider control is implemented using ATL library so it is really small and does not require for any additional DLLs (except for system one).


Invisible MFC

To make your MFC dialog-based application initially invisible perform following steps:

1. Clear 'Visible' check-box in the dialog box template's properties.

2. Override DoModal virtual function. Copy function body from MFC sources (file dlgcore.cpp). Locate lines

                                DWORD dwFlags = MLF_SHOWONIDLE;

                                if (GetStyle() & DS_NOIDLEMSG)

                                        dwFlags |= MLF_NOIDLEMSG;

                                VERIFY(RunModalLoop(dwFlags) == m_nModalResult);

Replace MLF_SHOWONIDLE flag with zero.


property AppVisible

Description

Determines if application is listed in the system task list. Available at run-time only.

Syntax

object.Blocking [= boolean ]

The syntax of the AppVisible property has these parts:

Part	Description

object	A Hider control.

boolean	A boolean flag that determines if the application is listed in the system task list. True - visible, False - invisible.

Remarks

Setting this property to False affects on application visibility in the task list only. It does not hide application main Window. However you can easily hide application's window using hide method (in Visual Basic) or ShowWindow(SW_HIDE) (in Visual C++).


property AutoRun

Description

Determines application's AutoRun behaviour.

Syntax

object.AutoRun [= integer ]

The syntax of the AutoRun property has these parts:

Part	Description

object	A Hider control.

integer	One of AutoRunConstants.

Remarks

Set this property to define auto-run behaviour. Hider control accepts following constants:

AutoRunNone	(0)

AutoRun disabled.

AutoRun	(1)

Automatically launch the application at Windows startup.

AutoRunOnce	(2)

Automatically launch the application next time only.

AutoRunService	(3)

Automatically launch the application as service at Windows startup. Unlike to regular AutoRun service applications are started before user login.